package edu.ivanov.apm.tests;

import edu.ivanov.apm.chaos.RuleProducer;

import java.util.HashMap;
import java.util.Map;

/**
 * User: Илья
 * Date: 09.10.13
 * Time: 23:24
 */
public class TestRuleProducer {

	public static void main(String[] args) {
		RuleProducer producer = new RuleProducer();
		producer.setAxiom("FX");

		Map<Character, String> productions = new HashMap<Character, String>();
		productions.put('F', "F");
		productions.put('X', "X+YF+");
		productions.put('Y', "-FX-Y");
		producer.setProductions(productions);

		String rule = producer.getAxiom();
		System.out.println(rule);

		for (int i = 0; i < 10; i++) {
			rule = producer.produce(rule);
			System.out.println(rule);
		}
	}
}
